//
//  CLJobViewController.m
//  Class_IOS
//
//  Created by peter on 14-8-29.
//  Copyright (c) 2014年 qiuyang. All rights reserved.
//

#import "CLJobViewController.h"
#import "CLJobTableViewCell.h"
#import "CLJobInfoViewController.h"

@interface CLJobViewController ()

@end

@implementation CLJobViewController

- (id)init
{
    self = [super init];
    if (self) {
        ;
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.view.backgroundColor = [UIColor clearColor];
    
    
    _jobTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NAVIGATIONHEIGHT, SCREENWIDTH, SCREENHEIGHT - NAVIGATIONHEIGHT) style:UITableViewStylePlain];
    _jobTableView.backgroundColor = [UIColor clearColor];
    _jobTableView.delegate = self;
    _jobTableView.dataSource = self;
    _jobTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    
    [self.view addSubview:_jobTableView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

#pragma  mark uitableviewdatasource methods
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 5;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 110;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *jobCellIdentifier = @"jobCellIdentifier";
    CLJobTableViewCell *jobCell = [tableView dequeueReusableCellWithIdentifier:jobCellIdentifier];
    if (!jobCell) {
        [tableView registerNib:[UINib nibWithNibName:@"CLJobTableViewCell" bundle:nil] forCellReuseIdentifier:jobCellIdentifier];
        jobCell = [tableView dequeueReusableCellWithIdentifier:jobCellIdentifier];
    }
    
    jobCell.backgroundColor = [UIColor clearColor];
    jobCell.selectionStyle = UITableViewCellAccessoryNone;
    
    
    return jobCell;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    CLJobInfoViewController *jobInfoVC = [[CLJobInfoViewController alloc] init];
    
    [self.navigationController pushViewController:jobInfoVC animated:YES];
    
}

@end
